package org.gwt.pluginframework.plugin;

import java.io.Serializable;

import com.google.gwt.user.client.ui.Widget;

/**
 * Interface representing Element which can be embedded into TabManager
 * (usually from Tabbable is created TabItem).
 * 
 * @author mszymanski
 */
public interface Tabbable extends Serializable {
	/**
	 * Internal tab id.
	 * @return
	 */
	String getId();
	
	/**
	 * Label for tab.
	 * @return
	 */
	String getLabel();
	
	/**
	 * Widget which will be added to tab as content (usually LayoutContainer or ContentPanel).
	 * @return
	 */
	Widget getBody();
	
	/**
	 * Can be closed or not.
	 * @return
	 */
	boolean isClosable();
	
	/**
	 * Method used on tab start.
	 */
	void onStart();
	
	/**
	 * MEthod used on before close.
	 */
	void onBeforeClose();
	
	/**
	 * Method used on close.
	 */
	void onClose();
	
	/**
	 * Method used on select.
	 */
	void onSelect();
}
